﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace BootyShaker
{
    public partial class FileSaveDialog : UserControl
    {
        public FileSaveDialog()
        {
            InitializeComponent();
        }
        Action<string, bool> Callback;
        public FileSaveDialog(string filename, Action<string,bool> callback):this()
        {
            FileName = filename;
            Callback = callback;
        }
        public string FileName { get { return txtFileName.Text; } set { txtFileName.Text = value; } }
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            // Update the main page with the returned data

            FileName = txtFileName.Text;

            // Close the popup.
            Callback(FileName, false);
          
        }

        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            Callback(FileName, true);
        }
    }
}
